Optimal. Leaf size=166 \[ -\frac{\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f (c-d)^{5/2} (c+d)^{5/2}}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 f \left (c^2-d^2\right )^2 (c+d \sec (e+f x))}+\frac{(b c-a d) \tan (e+f x)}{2 f \left (c^2-d^2\right ) (c+d \sec (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.300656, antiderivative size = 166, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {4003, 12, 3831, 2659, 208} \[ -\frac{\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f (c-d)^{5/2} (c+d)^{5/2}}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 f \left (c^2-d^2\right )^2 (c+d \sec (e+f x))}+\frac{(b c-a d) \tan (e+f x)}{2 f \left (c^2-d^2\right ) (c+d \sec (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4003
Rule 12
Rule 3831
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^3} \, dx &=\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\int \frac{\sec (e+f x) (-2 (a c-b d)-(b c-a d) \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx}{2 \left (c^2-d^2\right )}\\ &=\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}+\frac{\int \frac{\left (-3 b c d+a \left (2 c^2+d^2\right )\right ) \sec (e+f x)}{c+d \sec (e+f x)} \, dx}{2 \left (c^2-d^2\right )^2}\\ &=\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac{\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \int \frac{\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{2 \left (c^2-d^2\right )^2}\\ &=\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac{\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \int \frac{1}{1+\frac{c \cos (e+f x)}{d}} \, dx}{2 d \left (c^2-d^2\right )^2}\\ &=\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac{\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{c}{d}+\left (1-\frac{c}{d}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{d \left (c^2-d^2\right )^2 f}\\ &=\frac{\left (2 a c^2-3 b c d+a d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{(c-d)^{5/2} (c+d)^{5/2} f}+\frac{(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac{\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}\\ \end{align*}
Mathematica [A] time = 0.822732, size = 172, normalized size = 1.04 \[ \frac{\frac{\left (a d \left (d^2-4 c^2\right )+b c \left (2 c^2+d^2\right )\right ) \sin (e+f x)}{c (c-d)^2 (c+d)^2 (c \cos (e+f x)+d)}-\frac{2 \left (a \left (2 c^2+d^2\right )-3 b c d\right ) \tanh ^{-1}\left (\frac{(d-c) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )}{\left (c^2-d^2\right )^{5/2}}+\frac{d (a d-b c) \sin (e+f x)}{c (c-d) (c+d) (c \cos (e+f x)+d)^2}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.079, size = 236, normalized size = 1.4 \begin{align*}{\frac{1}{f} \left ( -2\,{\frac{1}{ \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c- \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}d-c-d \right ) ^{2}} \left ( -1/2\,{\frac{ \left ( 4\,acd+a{d}^{2}-2\,b{c}^{2}-bcd-2\,{d}^{2}b \right ) \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{3}}{ \left ( c-d \right ) \left ({c}^{2}+2\,cd+{d}^{2} \right ) }}+1/2\,{\frac{ \left ( 4\,acd-a{d}^{2}-2\,b{c}^{2}+bcd-2\,{d}^{2}b \right ) \tan \left ( 1/2\,fx+e/2 \right ) }{ \left ( c+d \right ) \left ({c}^{2}-2\,cd+{d}^{2} \right ) }} \right ) }+{\frac{2\,{c}^{2}a+a{d}^{2}-3\,bcd}{{c}^{4}-2\,{c}^{2}{d}^{2}+{d}^{4}}{\it Artanh} \left ({(c-d)\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ){\frac{1}{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}}} \right ){\frac{1}{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.628727, size = 1631, normalized size = 9.83 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \sec{\left (e + f x \right )}\right ) \sec{\left (e + f x \right )}}{\left (c + d \sec{\left (e + f x \right )}\right )^{3}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.48116, size = 564, normalized size = 3.4 \begin{align*} \frac{\frac{{\left (2 \, a c^{2} - 3 \, b c d + a d^{2}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (-2 \, c + 2 \, d\right ) + \arctan \left (-\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}}{{\left (c^{4} - 2 \, c^{2} d^{2} + d^{4}\right )} \sqrt{-c^{2} + d^{2}}} - \frac{2 \, b c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 \, a c^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - b c^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 3 \, a c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + b c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + a d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 2 \, b d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 2 \, b c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 4 \, a c^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - b c^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, a c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - b c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - a d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 2 \, b d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (c^{4} - 2 \, c^{2} d^{2} + d^{4}\right )}{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - c - d\right )}^{2}}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]